package net.csdn.business.common.domain.request;

import lombok.Data;
import net.csdn.business.common.domain.issue.IssueExt;
import net.csdn.business.common.domain.validation.groups.System;
import net.csdn.business.common.enums.UserTypeEnum;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author likun
 * @date 2022/6/14 11:29
 */
@Data
public class IssueSaveReqDto implements Serializable {
    @NotBlank(message = "uid 不合法", groups = {System.class})
    private String uid;

    /**
     * {@link UserTypeEnum}
     */
    private Integer userType;

    @NotNull(message = "projectId 不能为空")
    @Positive(message = "projectId 不合法")
    private Long projectId;

    // @NotNull(message = "privacy 不能为空")
    @Range(min = 0, max = 1, message = "privacy 不合法")
    private Integer privacy;

    @Range(min = 0, max = 50, message = "priority 不合法")
    private Integer priority;

    @NotBlank(message = "标题不能为空")
    @Length(min = 1, max = 200, message = "标题不能超过 200 个字符")
    private String title;

    @NotBlank(message = "内容不能为空")
    private String content;

    @NotBlank(message = "内容不能为空")
    private String mdContent;

    /**
     * 评论@username列表
     */
    private List<String> commentAts;

    @Length(min = 24, max = 24, message = "assignUser 不合法")
    private String assignUser;

    /**
     * 标签Ids
     */
    @Size(min = 1, max = 10, message = "labelIds 长度不能超过10")
    private List<String> labelIds;

    private Integer serialNumber;

    private IssueExt ext;

    private Boolean migrateFlag = false;

    private Date createdDate;

    private Date updatedDate;

    private Date closedDate;
}
